<?php
class AddLink extends Action {
	/*
	 * (non-PHPdoc) @see Action::execute()
	 */
	public function execute($params) {
		check_login ( ADMIN_LOGIN_PAGE );
		$data = sess_del ( 'link_form_data', array ('target' => "_blank",'display' => 1,'sort' => 9999 ) );
		$data ['error'] = sess_del ( 'link_form_error', array () );
		$data ['error_cls'] = ModelValidator::getErrorCls ( $data ['error'] );
		$data ['page_tip_info'] = sess_del ( 'page_tip_info' );
		$data ['alert_cls'] = 'alert-error';
		
		$types = CoreOptionModel::getOption ( 'link_types' );				
		$data ['types'] = ! empty ( $types ) ? array_merge ( array ('未分类' ), explode(',', $types )) : array ('未分类' );
		$data ['navi_active'] = '<i class="icon-plus"></i>友情链接';
		return new SmartyView ( $data, 'link/LinkForm' );
	}
}